package com.andy.war.script;

import com.andy.war.obj.battle.Army;
import com.andy.war.obj.battle.BattleContext;

public abstract class ChainCmd implements ICommand {
	
	ICommand next;
	
	public ICommand getNext() {
		return next;
	}

	public ChainCmd setNext(ICommand next) {
		this.next = next;
		return this;
	}

	@Override
	public void doCmd(BattleContext context,Army target) {
		doMyCmd(context,target);
		if(next != null){
			next.doCmd(context,target);
		}
	}
	
	
	public abstract void doMyCmd(BattleContext context,Army target);
	
}
